# 1.单线程
# 【2.多线程】
# 3.资源共享与竞争

import time
from threading import Thread, Lock

def funa():
    print('开始A')
    time.sleep(5)
    print('结束A')

def funb():
    print('开始B')
    time.sleep(7)
    print('结束B')

# 设置守护线程 当守护线程结束 其他线程也结束
if __name__ == '__main__' :
    ta = Thread(target=funa)
    tb = Thread(target=funb)
    tb.daemon = True
    tb.start()
    ta.daemon = True
    ta.start()
    print('守护线程结束')













